<?php
$page_title = "";
include 'functions.php';
include_once("top.php"); 
?>
<?php
//Creeaza interogarea
require_once ("/includes/mysql_connect.php"); //Realizeaza conexiunea la baza de date.
$query1 = "SELECT article_id, title, content, author, source FROM articole ORDER BY date_written DESC";
$result1 = @mysql_query($query1);
//Ruleaza interogarea
$resultArray = mysql_evaluate_array($query1);

echo "<table id='article-table'> <td  id='article-column', style='vertical-align:top;'>";
for($i = 0 ; $i<count($resultArray); $i = $i+2) {
	$row = $resultArray[$i];
	$limit = 5;
	$postValue = $row['article_id'];
	$filename = 'C:/wamp/www/uploads/'.$postValue.'.jpg';
	$post = substr($row['content'], 0, $limit) . '...<a href="newsbyid.php?id=' . $postValue . '"><img src="images/btn_more.gif"></a>';
	echo "<div id = 'article-div'>asdgsadfsafdsag";
	//echo "<h1><a href='newsbyid.php?id=". $postValue ."'>$row[title]</a>	</h1>";
	//echo "<hr  color='#CCCCCC' width='500px' align='left' />";
	//echo "<p class='text1'>";
	if (file_exists($filename))
	{
		//echo "<img src='".$filename."' align='right' width='100' height='140'>$post</p>";
	}
	else
	{
		//echo $post;
	}
	echo "</div>";
	//echo "<br><br><br>";
}
echo "</td> <td id='article-column', style='vertical-align: top;'>";
for($i = 1 ; $i<count($resultArray); $i = $i+2) {
	$row = $resultArray[$i];
	$limit = 5;
	$postValue = $row['article_id'];
	$filename = 'C:/wamp/www/uploads/'.$postValue.'.jpg';
	$post = substr($row['content'], 0, $limit) . '...<a href="newsbyid.php?id=' . $postValue . '"><img src="images/btn_more.gif"></a>';
	echo "<div id='article-div'>asdfgasdfsaf";
	//echo "<h1><a href='newsbyid.php?id=". $postValue ."'>$row[title]</a>	</h1>";
	//echo "<hr  color='#CCCCCC' width='500px' align='left' />";
	//echo "<p class='text1'>";
	if (file_exists($filename))
	{
		//echo "<img src='".$filename."' align='right' width='100' height='140'>$post</p>";
	}
	else
	{
		//echo $post;
	}
	echo "</div>";
	//echo "<br><br><br>";
}
echo "</td> </table>";
mysql_close();
		echo '<p class="rigth"><a href="google.ro">Google</a></p>';
?>
<div id="cf6_image"></div>
<?php
include_once("end.php");
?>
